![]() |
PATH![]() |
This section defines the fields that are common to all ATA Manager functions that use the ATA parameter block. The fields used for specific functions are defined in the description of the functions to which they apply. You use the ATA parameter block for all calls to the ATA Manager. The ataPBHdr data type defines the ATA parameter block.
ATA Manager 3.0 defines ATA parameter block version 3, which is required for the specification of ANSI ATA-2 compliant transfer timings, and DMA timing in particular. ATA Manager 4.0 and later support ANSI ATA-2 and ATA-3 compliant data transfer timings. Parameter block versions 1 and 2 are still supported, but full use of version 4.1.1 or later is recommended when the best data transfer performance of the device is required.
The parameter block includes a field, ataPBFunctionCode, in which you specify the function selector for the particular function to be executed; you must specify a value for this field. Each ATA function may use different fields of the ATA parameter block for parameters specific to that function.
An arrow preceding the comment indicates whether the parameter is an input parameter, an output parameter, or both.
--> | Input |
<-- | Output |
<--> | Both |
The following unique typedef identifiers are used in the ATA Manager parameter block and function definitions:
typedef | struct | ataPBHdr | /* ATA Manager parameter */ |
/* block header structure */ | |||
{ | |||
Ptr | ataPBLink; | /* Reserved, initiaize to 0 */ | |
SInt16 | ataPBQType; | /* Type byte */ | |
UInt8 | ataPBVers; | /* --> Parameter block */ | |
/* version number */ | |||
UInt8 | ataPBReserved; | /* Reserved */ | |
Ptr | ataPBReserved2; | /* Reserved */ | |
ProcPtr | ataPBCallbackPtr; | /* Universal completion*/ | |
/* routine pointer */ | |||
OSErr | ataPBResult; | /* <-- Returned result */ | |
UInt8 | ataPBFunctionCode; | /* --> Manager function*/ | |
/* code */ | |||
UInt8 | ataPBIOSpeed; | /* --> I/O timing class */ | |
UInt16 | ataPBFlags; | /* --> Control options */ | |
SInt16 | ataPBReserved3; | /* Reserved */ | |
long | ataPBDeviceID; | /* --> Device ID */ | |
UInt32 | ataPBTimeOut; | /* --> Transaction timeout*/ | |
/* value */ | |||
Ptr | ataPBClientPtr1; | /* Client storage Ptr 1 */ | |
Ptr | ataPBClientPtr2; | /* Client storage Ptr 2 */ | |
UInt16 | ataPBState; | /* Reserved, init to 0 */ | |
SInt16 | ataPBSemaphores; | /* Reserved */ | |
SInt32 | ataPBReserved4; | /* Reserved */ | |
} ataPBHdr; |
typedef | struct | /* Device ID structure */ |
{ | ||
UInt16 | Reserved; | /* The upper word is reserved */ |
UInt8 | devNum; | /* Consists of device ID */ |
UInt8 | busNum | /* bus ID number */ |
} deviceIdentification; |
-- | 0-2 | Reserved. | ||||||||||||||||||||
RegUpdate | 3 | When set to 1 this bit indicates
that a set of device registers should be reported back on completion of
the request. This bit is valid for the ATA_ExecI/O function only.
Refer to the description on ATA_ExecIO
for details. The following device registers are reported back:
Sector count register Sector number register Cylinder register(s) SDH register |
||||||||||||||||||||
ProtocolType | 5-4 | These bits specify the type of
command:
00 = Standard ATA 01 = Reserved 11 = ATAPI These bits indicate how the protocol should be handled for the command type. Setting the bits to ATAPI and providing a non-zero packet command pointer indicates that a packet command should be sent prior to any data transfers. For ATA command values of A0 and A1 hexadecimal, this field should contain the ATAPI setting. For all other ATA commands, the field must contain the ATA setting. |
||||||||||||||||||||
-- | 6 | Reserved | ||||||||||||||||||||
UseDMA | 7 | When set to 1, this bit indicates the data transfer is to be via DMA. DMA transfers are only valid with version 3.0 or greater of the ATA Manager and on system hardware that supports DMA. DMA transfers to and from ATA devices use different command codes from the PIO transfers. The state of this bit must correspond to the command code. | ||||||||||||||||||||
SGType | 9-8 | This 2-bit field specifies the
type of scatter gather list passed in. This field is only valid for read/write
operations.
The following types are defined:
|
||||||||||||||||||||
The format of the scatter gather list is a series of the following structure definition: | ||||||||||||||||||||||
| ||||||||||||||||||||||
QLockOnError | 10 | When set to 0, this bit indicates that an error during the transaction should not freeze the I/O queue for the device. When an error occurs on an I/O request with this bit set to 0, the next queued request is processed following this request. When an error occurs with this bit set to 1, any I/O request without the Immediate bit set is halted until an ATA_QRelease command is issued. A status code of hexadecimal $717 is returned for subsequent asynchronous I/O requests until the I/O Queue Release command is issued. This permits the client application to examine the state at the time of the error. However, use with caution. When this bit is set to 1 and an error condition is not handled correctly, the system will hang. | ||||||||||||||||||||
Immediate | 11 | When this bit is set to 1, it indicates that the request must be executed as soon as possible and the status of the request must be returned. It forces the request to the head of the I/O queue for immediate execution. When this bit is set to 0, the request is queued in the order received and is executed according to that order. | ||||||||||||||||||||
ATAioDirection | 13-12 | This bit field specifies the direction
of data transfer. Bit values are binary and defined as follows:
00= No data transfer 10 = Data direction in (read) 01= Data direction out (write) 11 = Reserved These bits do not need to specify the direction of the ATAPI command packet bytes. |
||||||||||||||||||||
ByteSwap | 14 | When set to 1, this bit indicates that every byte of data prior to transmission on write operations and upon reception on read operations is to be swapped. When this bit is set to 0, it forces bytes to go out in the LSB-MSB format compatible with IBM clones. Typically, this bit should be set to 0. Setting this bit has performance implications because the byte swap is performed by the software. Use this bit with caution. ATAPI command packet bytes are swapped when this bit is set to 1. | ||||||||||||||||||||
UseConfigSpeed | 15 | When set to 1, this bit indicates that the current I/O speed setting specified in the most recent call to the ATA_SetDevConfig command should be used to transfer data across the ATA interface. If a ATA_SetDevConfig command has not been issued since power on, then the default setting of PIO mode 0 and singleword DMA mode 0 are used. |
Previous | Back Up One Level | Next | Show Frames | Hide Frames